package hsb.ruoyi.common.config;

import org.apache.ibatis.logging.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * @author 胡帅博
 * @date 2023/1/1 14:41
 */
public class MybatisLogImpl implements Log {
    Logger log = null;

    public MybatisLogImpl(String clazz) {
    //    Logger logger = LoggerFactory.getLogger(clazz);
        log =
                LoggerFactory.getLogger(MybatisLogImpl.class);
        System.out.println(clazz);
    }

    @Override
    public boolean isDebugEnabled() {
        return true;
    }

    @Override
    public boolean isTraceEnabled() {
        return log.isTraceEnabled();
    }

    @Override
    public void error(String s, Throwable e) {
        log.error(s, e);
    }

    @Override
    public void error(String s) {
        log.error(s);
    }

    @Override
    public void debug(String s) {
        System.out.println(s);
        log.debug(s);
    }

    @Override
    public void trace(String s) {
        log.trace(s);
    }

    @Override
    public void warn(String s) {
        log.warn(s);
    }
}
